home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / impreadrow.z / impreadrow
Text File  |  1998-10-30  |  8KB  |  133 lines

  1.  
  2.  
  3.  
  4. iiiimmmmppppRRRReeeeaaaaddddRRRRoooowwww((((3333))))                    IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                     iiiimmmmppppRRRReeeeaaaaddddRRRRoooowwww((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      impReadRow, impReadRowB, impWriteRow, impWriteRowB - read/write SGI Image
  10.      Format files
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<iiiimmmmpppp....hhhh>>>>
  14.  
  15.      iiiinnnntttt iiiimmmmppppRRRReeeeaaaaddddRRRRoooowwww((((IIIIMMMMPPPPIIIImmmmaaaaggggeeee ****iiiimmmmaaaaggggeeee,,,, sssshhhhoooorrrrtttt ****bbbbuuuuffffffffeeeerrrr,,,,
  16.                     uuuusssshhhhoooorrrrtttt____tttt rrrroooowwww,,,, uuuusssshhhhoooorrrrtttt____tttt cccchhhhaaaannnnnnnneeeellll))));;;;
  17.  
  18.      iiiinnnntttt iiiimmmmppppRRRReeeeaaaaddddRRRRoooowwwwBBBB((((IIIIMMMMPPPPIIIImmmmaaaaggggeeee ****iiiimmmmaaaaggggeeee,,,, uuuucccchhhhaaaarrrr____tttt ****bbbbuuuuffffffffeeeerrrr,,,,
  19.                      uuuusssshhhhoooorrrrtttt____tttt rrrroooowwww,,,, uuuusssshhhhoooorrrrtttt____tttt cccchhhhaaaannnnnnnneeeellll))));;;;
  20.  
  21.      iiiinnnntttt iiiimmmmppppWWWWrrrriiiitttteeeeRRRRoooowwww((((IIIIMMMMPPPPIIIImmmmaaaaggggeeee ****iiiimmmmaaaaggggeeee,,,, sssshhhhoooorrrrtttt ****bbbbuuuuffffffffeeeerrrr,,,,
  22.                      uuuusssshhhhoooorrrrtttt____tttt rrrroooowwww,,,, uuuusssshhhhoooorrrrtttt____tttt cccchhhhaaaannnnnnnneeeellll))));;;;
  23.  
  24.      iiiinnnntttt iiiimmmmppppWWWWrrrriiiitttteeeeRRRRoooowwwwBBBB((((IIIIMMMMPPPPIIIImmmmaaaaggggeeee ****iiiimmmmaaaaggggeeee,,,, uuuucccchhhhaaaarrrr____tttt ****bbbbuuuuffffffffeeeerrrr,,,,
  25.                       uuuusssshhhhoooorrrrtttt____tttt rrrroooowwww,,,, uuuusssshhhhoooorrrrtttt____tttt cccchhhhaaaannnnnnnneeeellll))));;;;
  26.  
  27. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  28.      _i_m_p_R_e_a_d_R_o_w and _i_m_p_R_e_a_d_R_o_w_B each read a row of image data from the
  29.      specified channel of an SGI Image Format file.  _i_m_p_R_e_a_d_R_o_w stores the row
  30.      data in an array of _s_h_o_r_t integers and therefore can read image data that
  31.      is either one or two bytes per pixel per channel in width. _i_m_p_R_e_a_d_R_o_w_B
  32.      stores the data in a character array and can only handle image data that
  33.      is one byte per pixel per channel wide.  If _i_m_p_R_e_a_d_R_o_w_B is called to read
  34.      image data that is two bytes per pixel per channel, an error condition is
  35.      reported.
  36.  
  37.      _i_m_p_W_r_i_t_e_R_o_w and _i_m_p_W_r_i_t_e_R_o_w_B each write a row of image data to the
  38.      specified channel of an SGI Image file. _i_m_p_W_r_i_t_e_R_o_w writes one or two
  39.      byte per pixel per channel image row data. _i_m_p_W_r_i_t_e_R_o_w_B writes only one
  40.      byte per pixel data. It is an error to use _i_m_p_W_r_i_t_e_R_o_w_B to write to
  41.      images that expect two byte per pixel per channel data.
  42.  
  43.      The functions take the following parameters.
  44.  
  45.      _i_m_a_g_e          Pointer to an _I_M_P_I_m_a_g_e structure returned by a call to
  46.                     _i_m_p_O_p_e_n or _i_m_p_O_p_e_n_F_d.
  47.  
  48.      _b_u_f_f_e_r         Caller allocated buffer containing the data to write to or
  49.                     to be filled with the data read from the image. The amount
  50.                     of storage allocated for the buffer should be
  51.                     impXSize(image) * sizeof(short) if _i_m_p_R_e_a_d_R_o_w or
  52.                     _i_m_p_W_r_i_t_e_R_o_w functions are used and impXSize(image) _i_f
  53.                     _i_m_p_R_e_a_d_R_o_w_B _o_r _i_m_p_W_r_i_t_e_R_o_w_B _a_r_e _u_s_e_d.
  54.  
  55.      _r_o_w            The image row to read. Rows are numbered from 0 through
  56.                     impYSize(image) - 1.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiimmmmppppRRRReeeeaaaaddddRRRRoooowwww((((3333))))                    IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo                     iiiimmmmppppRRRReeeeaaaaddddRRRRoooowwww((((3333))))
  71.  
  72.  
  73.  
  74.      _c_h_a_n_n_e_l        The image channel to read. Channels are numbered from 0
  75.                     through impNumChannels(image) - 1.
  76.  
  77. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  78.      If execution was successful, all functions return the number of pixels
  79.      (not bytes) read or written. If an execution error occurred, -1 is
  80.      returned and _I_M_P_e_r_r_n_o is set.
  81.  
  82. EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
  83.      In addition to the system error codes defined in _e_r_r_n_o._h, the following
  84.      _l_i_b_i_m_p specific error codes may be returned.
  85.  
  86.      _i_m_p_W_r_i_t_e_R_o_w and _i_m_p_W_r_i_t_e_R_o_w_B will fail under the following circumstances.
  87.  
  88.      IMP_ERR_WRITEFLAG        Attempt to write to an image file not opened for
  89.                               writing.
  90.  
  91.      IMP_ERR_BADBPP           Unsupported bytes per pixel value. Refer to
  92.                               _i_m_p._h for supported BPP values.
  93.  
  94.      IMP_ERR_BADIMAGE         Unrecognized image type. Refer to _i_m_p._h for
  95.                               supported image types.
  96.  
  97.      IMP_ERR_SHORTWRITE       A complete row of data could not be written.
  98.  
  99.      _i_m_p_R_e_a_d_R_o_w and _i_m_p_R_e_a_d_R_o_w_B will fail under the following circumstances.
  100.  
  101.      IMP_ERR_READFLAG         Attempt to read from an image file not opened
  102.                               for reading.
  103.  
  104.      IMP_ERR_BADBPP           Unsupported bytes per pixel value. Refer to
  105.                               _i_m_p._h for supported BPP values.
  106.  
  107.      IMP_ERR_BADIMAGE         Unrecognized image type. Refer to _i_m_p._h for
  108.                               supported image types.
  109.  
  110.      IMP_ERR_SHORTREAD        The amount of data read was less than the amount
  111.                               expected based on the image size.
  112.  
  113. NNNNOOOOTTTTEEEE
  114.      It is the caller's responsibility to allocate enough buffer storage for
  115.      image row data.
  116.  
  117. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  118.      libimp(3), impOpen(3)
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.